package com.weixing.mall.provider.model.vo.cms;

import com.weixing.mall.provider.model.enums.AreaLevelEunm;
import lombok.Data;

import java.util.List;

/**
 * @ClassName CityAreaTreeVo
 * @Description TODO <br/>
 * @Author gjq
 * @Modified By:
 * @Date 2019/7/30
 * @Version 1.0
 **/
@Data
public class CityAreaTreeVo {

    private Long id;
    private String areaName;
    private String areaCode;
    private AreaLevelEunm areaLevel;
    private String parentCode;
    private String zipCode;
    private String areaPath;

    private List<CityAreaTreeVo> children;
    public int hashcode() {
        return areaCode.hashCode();
    }
    @Override
    public boolean equals(Object obj) {  // 重写equals()方法。
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (obj instanceof CityAreaTreeVo) {
            CityAreaTreeVo p = (CityAreaTreeVo) obj;
            return areaCode.equalsIgnoreCase(p.getAreaCode());
        }
        return false;
    }
}
